Page({

  data: {
    url: ''
  },


  onLoad(options) {
    this.setData({
      url: decodeURIComponent(options.url)
    })
  },

  handleMessage(e) {
    if (e.detail && e.detail.data[0]) {
      let data = e.detail.data[0].extraData
      let type = data.type;
      let url = data.url;
      if (type == 1) {
        if (url) {
          wx.navigateTo({
            url
          })
        } else {
          wx.navigateBack()
        }
      } else if (type == 2) {
        wx.navigateToMiniProgram({
          appId: url
        })
      }
    }
  },

})